package com.jml.策略模式.重构if判断.msg.strategy.factory;



import com.jml.策略模式.重构if判断.msg.strategy.MsgStrategy;
import com.jml.策略模式.重构if判断.msg.strategy.impl.AliYunStrategy;
import com.jml.策略模式.重构if判断.msg.strategy.impl.HuaWeiStrategy;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


public class FactoryStrategy {
    private static Map<String, MsgStrategy> msgStrategys = new ConcurrentHashMap<>();


    static {
        msgStrategys.put("huawei", new HuaWeiStrategy());
        msgStrategys.put("aliyun", new AliYunStrategy());
    }

    public static MsgStrategy getContextStrategy(String strategyId) {
        return msgStrategys.get(strategyId);
    }

}
